<extend name="Index:base" />
        <block name="b_content">
            <div id="content-header">
                <h1>设置推荐位</h1>
            </div>
            <div id="breadcrumb">
                <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
                <a href="#" class="current">设置推荐位</a>
            </div>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget-box">
                            <div class="widget-title">
                                <span class="icon">
                                    <input type="checkbox" id="title-checkbox" name="title-checkbox" />
                                </span>
                                <h5>职位推荐列表</h5>
                            </div>
                            <div class="widget-content nopadding">
                                <table class="table table-bordered table-striped with-check">
                                    <thead>
                                        <tr>
                                            <th><i class="icon-resize-vertical"></i></th>
                                            <th>位置序号</th>
                                            <th>职位ID</th>
                                            <th>职位名称</th>
                                            <th>隶属团队</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="jobs" id="job" >
                                        <tr>
                                            <td><input type="checkbox" /></td>
                                            <td>{$job.sortid}</td>
                                            <td>{$job.jid}</td>
                                            <td>{$job.jname}</td>
                                            <td>{$job.tname}</td>
                                            <td>
                                                <a href="javascript:delRecommend(1,{$job.sortid});" class="btn">删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget-box">
                            <div class="widget-title">
                                <span class="icon">
                                    <input type="checkbox" id="title-checkbox" name="title-checkbox" />
                                </span>
                                <h5>人才推荐列表</h5>
                            </div>
                            <div class="widget-content nopadding">
                                <table class="table table-bordered table-striped with-check">
                                    <thead>
                                        <tr>
                                            <th><i class="icon-resize-vertical"></i></th>
                                            <th>位置序号</th>
                                            <th>人才UID</th>
                                            <th>账号</th>
                                            <th>昵称</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="talents" id="talent" >
                                        <tr>
                                            <td><input type="checkbox" /></td>
                                            <td>{$talent.sortid}</td>
                                            <td>{$talent.uid}</td>
                                            <td>{$talent.email}</td>
                                            <td>{$talent.nickname}</td>
                                            <td>
                                                <a href="javascript:delRecommend(2,{$talent.sortid});" class="btn">删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </block>
<block name="b_footer_script">
    <div style="display: none;">
        <div id="sendbox" class="popbox-bg">
            <div class="title">发送消息</div>
            <div class="body">
                <p>内容</p>
                <textarea id="msg" placeholder="在这里输入消息内容……"></textarea>
                <p><a id='send' class="btn">发送</a><a id="cancel" class="btn pull-right">关闭</a></p>
            </div>
        </div>
    </div>
    <script>
        function acceptBat(uid){
            var url = "{:U('/Prom/Index/acceptCheck_ajax@'. getDomain())}";
            $.post(url, {'uid':uid}, function(data){
                var vdata = eval(data);
                if(vdata.success==1){
                    alert('审核成功！');
                    window.location.reload();
                }else{
                    alert(vdata.msg);
                }
            }, 'json');
        }
        
        function cancelCheck(uid){
            var url = "{:U('/Prom/Index/cancelCheck_ajax@'. getDomain())}";
            $.post(url, {'uid':uid}, function(data){
                var vdata = eval(data);
                if(vdata.success==1){
                    alert('已经撤销对该用户的审核！');
                    window.location.reload();
                }else{
                    alert(vdata.msg);
                }
            }, 'json');
        }
        
        function sendMsg(recevier,nickname) {
            $('#sendbox .title').text('向 ['+nickname+'] 发送消息');
            $('#sendbox #send').unbind('click');
            $('#sendbox #send').click(function(){
                var url = "{:U('/Prom/Index/sendmsg_ajax@'. getDomain())}";
                var text = $('#sendbox #msg').val();
                if(text==''){
                    alert('未填写消息');
                    return fasle;
                }
                $.post(url, {'receiver':recevier, 'text':text}, function(data){
                    var vdata = eval(data);
                    if(vdata.success==1){
                        alert('消息发送成功！');
                    }else{
                        alert(vdata.msg);
                    }
                }, 'json');
            });
            $('#sendbox #cancel').unbind('click');
            $('#sendbox #cancel').click(function(){
                $.fancybox.close();
            });
            $.fancybox.open("#sendbox", { closeBtn: false, 'scrolling':'no', padding:0});
            return false;
        }
        
        function delRecommend(stype,pos){
            var url = "{:U('/Prom/Index/delrecom_ajax@'. getDomain())}";
            $.post(url, {'stype':stype,'pos':pos}, function(data){
                var vdata = eval(data);
                if(vdata.success==1){
                    window.location.reload();
                }
                else {
                    alert("删除失败！");
                }
            }, 'json');
        }
    </script>
</block>